<?php 
namespace Admin\Controller;

//分类 控制器
class CommentController extends AdminController{
	

	//结果列表
	public function index(){
		
		//实例化
		$comment = M('comment');
		//获取分类信息
		$list = $comment->select();
		// $list = $category->getHomeCate();
		$this->assign('list',$list);
		$this->display();

		//分类查询的另一种方式
		//$list = $category->getTree(0);
	
	}


	//删除
	public function del(){
		//实例化
		$comment = M('comment');
		//拼装删除条件
		$map['id'] = array('eq',I('id'));
		if($comment->where($map)->delete()>0){
			$this->success("删除成功！",U('Comment/index'),3);
		}else{
			$this->error("删除失败");
		}
	}

}

